Skip to content

Conversation

teemingc
Copy link
Contributor

@teemingc teemingc commented Sep 25, 2025

follow-up to #1771
Closes #1662

📑 Description

This PR adjusts all the import statements which only import types to be type-only import statements. This should properly solve those empty import statements importing from '..' in the Svelte playground. (for good this time?)
cc: @shinokada

Status

  • Not Completed
  • Completed

✅ Checks

  • My pull request adheres to the code style of this project
  • My code requires changes to the documentation
  • I have updated the documentation and api-check directory as required
  • All the tests and check have passed by running pnpm check && pnpm test:e2e
  • My pull request is based on the latest commit (not the npm version).
  • I have checked the page with https://validator.unl.edu/

ℹ Additional Information

Summary by CodeRabbit

  • New Features
    • No user-facing features added in this release.
  • Refactor
    • Standardized TypeScript type-only imports across many components for consistency and potential bundle-size benefits.
  • Chores
    • Codebase maintenance aligning imports with TypeScript best practices to improve tooling and build hygiene.
  • Bug Fixes
    • None.
  • Documentation
    • None.

Note: These changes do not affect runtime behavior or public APIs.

Copy link

vercel bot commented Sep 25, 2025

@teemingc is attempting to deploy a commit to the Themesberg Team on Vercel.

A member of the Team first needs to authorize it.

Copy link
Contributor

coderabbitai bot commented Sep 25, 2025

Walkthrough

This pull request converts numerous TypeScript type imports across Svelte components to use the import type syntax. The changes are limited to import declarations, affecting compile-time typing only. No runtime logic, control flow, or public API signatures are modified.

Changes

Cohort / File(s) Summary of changes
Accordion components
src/lib/accordion/Accordion.svelte, src/lib/accordion/AccordionItem.svelte
Converted type imports to use import type {...}; no runtime changes.
Bottom navigation
src/lib/bottom-navigation/BottomNavHeader.svelte, src/lib/bottom-navigation/BottomNavHeaderItem.svelte, src/lib/bottom-navigation/BottomNavItem.svelte
Switched to type-only imports for props/context types.
Breadcrumbs
src/lib/breadcrumb/Breadcrumb.svelte, src/lib/breadcrumb/BreadcrumbItem.svelte
Changed to import type for breadcrumb prop types.
Button group & buttons
src/lib/button-group/ButtonGroup.svelte, src/lib/buttons/Button.svelte
Type-only imports for props and size types.
Card
src/lib/card/Card.svelte
Converted prop type import to import type.
Carousel
src/lib/carousel/ControlButton.svelte, src/lib/carousel/Slide.svelte, src/lib/carousel/Thumbnail.svelte
Replaced value-type imports with type-only imports for props/state.
Clipboard
src/lib/clipboard/Clipboard.svelte
Switched to type-only import for props.
Dark mode
src/lib/darkmode/DarkMode.svelte
Converted props import to import type.
Device mockups
src/lib/device-mockups/Android.svelte, .../DefaultMockup.svelte, .../Desktop.svelte, .../Laptop.svelte, .../Smartwatch.svelte
Standardized prop imports to type-only.
Drawer
src/lib/drawer/Drawer.svelte, src/lib/drawer/Drawerhead.svelte
Type-only imports for prop types.
Dropdown
src/lib/dropdown/DropdownDivider.svelte, .../DropdownGroup.svelte, .../DropdownHeader.svelte, .../DropdownItem.svelte
Converted to import type for dropdown props.
Footer
src/lib/footer/Footer.svelte, .../FooterBrand.svelte, .../FooterCopyright.svelte, .../FooterIcon.svelte, .../FooterLink.svelte, .../FooterLinkGroup.svelte
Prop type imports now use import type.
Forms: button toggle
src/lib/forms/button-toggle/ButtonToggle.svelte, .../CheckIcon.svelte
Type-only imports for props/context.
Forms: checkbox
src/lib/forms/checkbox/CheckboxButton.svelte
Switched props import to type-only.
Forms: dropzone
src/lib/forms/dropzone/Dropzone.svelte
Converted prop import to import type.
Forms: helper & label
src/lib/forms/helper/Helper.svelte, src/lib/forms/label/Label.svelte
Type-only imports for prop types.
Forms: phone input
src/lib/forms/phoneinput/PhoneInput.svelte
Prop type import switched to type-only.
Forms: radio & toggle & range
src/lib/forms/radio/Radio.svelte, src/lib/forms/toggle/Toggle.svelte, src/lib/forms/range/Range.svelte
Changed to import type for props (and Label where imported).
Gallery
src/lib/gallery/Gallery.svelte
Type-only imports for GalleryProps and ImgType.
Indicator
src/lib/indicator/Indicator.svelte
Prop type import now type-only.
Kbd
src/lib/kbd/Kbd.svelte
Switched to import type for props.
List group
src/lib/list-group/Listgroup.svelte, src/lib/list-group/ListgroupItem.svelte
Converted imports to type-only for props/items.
Sidebar
src/lib/sidebar/SidebarItem.svelte
Type-only imports for context and props.
Skeleton
src/lib/skeleton/TestimonialPlaceholder.svelte, src/lib/skeleton/WidgetPlaceholder.svelte
Prop type imports updated to import type.
Step indicator
src/lib/step-indicator/StepIndicator.svelte
Switched to type-only import for props.
Stepper
src/lib/stepper/BreadcrumbStepper.svelte, .../DetailedStepper.svelte, .../ProgressStepper.svelte, .../Stepper.svelte, .../TimelineStepper.svelte, .../VerticalStepper.svelte
All prop type imports converted to import type.
Table
src/lib/table/Table.svelte
Type-only imports for TableProps and TableCtxType.
Tabs
src/lib/tabs/TabItem.svelte
Converted SelectedTab/TabCtxType/TabitemProps to type-only imports.
Types module
src/lib/types.ts
Writable and VariantProps changed to type-only imports.
Utils
src/lib/utils/Arrow.svelte, src/lib/utils/CloseButton.svelte
Prop type imports updated to import type.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Possibly related PRs

Poem

A nibble of types, a hop in the night,
I swapped my imports, kept runtime light.
No wires were crossed, no props took flight—
Just tidier trails in TypeScript’s sight.
Thump-thump, approve? Feels just right! 🐇✨

Pre-merge checks and finishing touches

✅ Passed checks (5 passed)
Check name Status Explanation
Title Check ✅ Passed The pull request title clearly summarizes the main change by stating that all empty import statements are removed, directly reflecting the core update of converting type imports to type-only syntax to eliminate empty imports.
Linked Issues Check ✅ Passed The changes adjust all import statements to type-only imports, which directly addresses the Svelte REPL resolution error described in issue #1662 by preventing empty import statements and ensuring proper module resolution in the playground.
Out of Scope Changes Check ✅ Passed All modifications are confined to changing import syntax to type-only imports, and no unrelated code or features have been introduced, so there are no out-of-scope changes.
Description Check ✅ Passed The description follows the repository template by closing the linked issue, providing a clear summary under the Description heading, indicating completion status, listing the required checks, and including the optional Additional Information section.
Docstring Coverage ✅ Passed No functions found in the changes. Docstring coverage check skipped.
✨ Finishing touches
  • 📝 Generate Docstrings
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
src/lib/forms/toggle/Toggle.svelte (1)

4-27: Restore Label as a value import

Label is rendered as a component (Line 17). By switching to import type, the compiler erases it at runtime, so Label becomes undefined, and the toggle will fail the moment it renders. Keep Label as a runtime import while leaving ToggleProps type-only.

-import type { ToggleProps, Label } from "$lib";
+import { Label, type ToggleProps } from "$lib";
📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 87c358d and f439251.

📒 Files selected for processing (62)
  • src/lib/accordion/Accordion.svelte (1 hunks)
  • src/lib/accordion/AccordionItem.svelte (1 hunks)
  • src/lib/bottom-navigation/BottomNavHeader.svelte (1 hunks)
  • src/lib/bottom-navigation/BottomNavHeaderItem.svelte (1 hunks)
  • src/lib/bottom-navigation/BottomNavItem.svelte (1 hunks)
  • src/lib/breadcrumb/Breadcrumb.svelte (1 hunks)
  • src/lib/breadcrumb/BreadcrumbItem.svelte (1 hunks)
  • src/lib/button-group/ButtonGroup.svelte (1 hunks)
  • src/lib/buttons/Button.svelte (1 hunks)
  • src/lib/card/Card.svelte (1 hunks)
  • src/lib/carousel/ControlButton.svelte (1 hunks)
  • src/lib/carousel/Slide.svelte (1 hunks)
  • src/lib/carousel/Thumbnail.svelte (1 hunks)
  • src/lib/clipboard/Clipboard.svelte (1 hunks)
  • src/lib/darkmode/DarkMode.svelte (1 hunks)
  • src/lib/device-mockups/Android.svelte (1 hunks)
  • src/lib/device-mockups/DefaultMockup.svelte (1 hunks)
  • src/lib/device-mockups/Desktop.svelte (1 hunks)
  • src/lib/device-mockups/Laptop.svelte (1 hunks)
  • src/lib/device-mockups/Smartwatch.svelte (1 hunks)
  • src/lib/drawer/Drawer.svelte (1 hunks)
  • src/lib/drawer/Drawerhead.svelte (1 hunks)
  • src/lib/dropdown/DropdownDivider.svelte (1 hunks)
  • src/lib/dropdown/DropdownGroup.svelte (1 hunks)
  • src/lib/dropdown/DropdownHeader.svelte (1 hunks)
  • src/lib/dropdown/DropdownItem.svelte (1 hunks)
  • src/lib/footer/Footer.svelte (1 hunks)
  • src/lib/footer/FooterBrand.svelte (1 hunks)
  • src/lib/footer/FooterCopyright.svelte (1 hunks)
  • src/lib/footer/FooterIcon.svelte (1 hunks)
  • src/lib/footer/FooterLink.svelte (1 hunks)
  • src/lib/footer/FooterLinkGroup.svelte (1 hunks)
  • src/lib/forms/button-toggle/ButtonToggle.svelte (1 hunks)
  • src/lib/forms/button-toggle/CheckIcon.svelte (1 hunks)
  • src/lib/forms/checkbox/CheckboxButton.svelte (1 hunks)
  • src/lib/forms/dropzone/Dropzone.svelte (1 hunks)
  • src/lib/forms/helper/Helper.svelte (1 hunks)
  • src/lib/forms/label/Label.svelte (1 hunks)
  • src/lib/forms/phoneinput/PhoneInput.svelte (1 hunks)
  • src/lib/forms/radio/Radio.svelte (1 hunks)
  • src/lib/forms/range/Range.svelte (1 hunks)
  • src/lib/forms/toggle/Toggle.svelte (1 hunks)
  • src/lib/gallery/Gallery.svelte (1 hunks)
  • src/lib/indicator/Indicator.svelte (1 hunks)
  • src/lib/kbd/Kbd.svelte (1 hunks)
  • src/lib/list-group/Listgroup.svelte (1 hunks)
  • src/lib/list-group/ListgroupItem.svelte (1 hunks)
  • src/lib/sidebar/SidebarItem.svelte (1 hunks)
  • src/lib/skeleton/TestimonialPlaceholder.svelte (1 hunks)
  • src/lib/skeleton/WidgetPlaceholder.svelte (1 hunks)
  • src/lib/step-indicator/StepIndicator.svelte (1 hunks)
  • src/lib/stepper/BreadcrumbStepper.svelte (1 hunks)
  • src/lib/stepper/DetailedStepper.svelte (1 hunks)
  • src/lib/stepper/ProgressStepper.svelte (1 hunks)
  • src/lib/stepper/Stepper.svelte (1 hunks)
  • src/lib/stepper/TimelineStepper.svelte (1 hunks)
  • src/lib/stepper/VerticalStepper.svelte (1 hunks)
  • src/lib/table/Table.svelte (1 hunks)
  • src/lib/tabs/TabItem.svelte (1 hunks)
  • src/lib/types.ts (1 hunks)
  • src/lib/utils/Arrow.svelte (1 hunks)
  • src/lib/utils/CloseButton.svelte (1 hunks)
🧰 Additional context used
🧠 Learnings (1)
📚 Learning: 2024-10-18T09:38:03.879Z
Learnt from: Chizaruu
PR: themesberg/flowbite-svelte#1465
File: src/lib/forms/Timepicker.svelte:105-116
Timestamp: 2024-10-18T09:38:03.879Z
Learning: In `Timepicker.svelte`, the `Dropdown` opens as intended and is used exclusively with the 'dropdown' and 'timerange-dropdown' Timepicker types.

Applied to files:

  • src/lib/dropdown/DropdownItem.svelte
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
  • GitHub Check: Playwright and Lint
🔇 Additional comments (59)
src/lib/carousel/Thumbnail.svelte (1)

3-3: Type-only import matches the pure-type usage.

ThumbnailProps is used exclusively for typing the component props, so switching to import type keeps the bundle clean and avoids generating empty imports. Looks good.

src/lib/forms/button-toggle/CheckIcon.svelte (1)

2-2: Type-only import fixes the REPL bundler issue

Switching to import type avoids emitting an empty runtime import, aligning with the PR goal and keeping the component clean.

src/lib/forms/dropzone/Dropzone.svelte (1)

5-5: Type-only import keeps Dropzone lean.

Switching DropzoneProps to a type-only import matches its usage and avoids emitting an empty runtime import.

src/lib/drawer/Drawerhead.svelte (1)

4-4: Type-only import matches usage

DrawerheadProps is only used for typing the destructured props, so this change cleanly prevents bundling an unnecessary runtime import.

src/lib/stepper/TimelineStepper.svelte (1)

4-4: Type-only import aligns with intent

Switching TimelineStepperProps to a type-only import keeps the runtime bundle clean while preserving typings. Looks good.

src/lib/accordion/AccordionItem.svelte (1)

2-2: Type-only imports are correct here

AccordionCtxType, AccordionItemProps, and ParamsType are all consumed purely in type positions, so this import split is safe.

src/lib/carousel/ControlButton.svelte (1)

4-4: Import cleanup confirmed

ControlButtonProps is used only for annotating $props(), so the dedicated type import is appropriate.

src/lib/device-mockups/Android.svelte (1)

2-2: Type-only import is appropriate

AndroidProps feeds only into the props typing; moving it to a type-only import avoids unnecessary runtime references.

src/lib/gallery/Gallery.svelte (1)

4-4: Typed gallery imports look good

Both GalleryProps and ImgType remain strictly in type contexts, so this change keeps bundling behavior intact.

src/lib/breadcrumb/Breadcrumb.svelte (1)

4-4: Breadcrumb props import simplified

BreadcrumbProps is used purely for typing the props destructure; the type-only import is the right call.

src/lib/carousel/Slide.svelte (1)

2-2: Type-only Slide imports verified

SlideProps and CarouselState stay in annotations and generics, so dropping the runtime import is safe.

src/lib/list-group/ListgroupItem.svelte (1)

4-4: Listgroup type import checks out

ListgroupItemProps is only used for $props() typing, making the type-only import the correct approach.

src/lib/sidebar/SidebarItem.svelte (1)

4-4: Type-only import prevents stray runtime dependency

Switching SidebarCtxType/SidebarItemProps to import type keeps the compiled output free of empty imports while leaving the component logic untouched. Looks great.

src/lib/drawer/Drawer.svelte (1)

2-2: Drawer props now stay purely in the type layer

The move to import type here cleanly avoids runtime noise from $lib when this component is bundled. Nicely done.

src/lib/forms/phoneinput/PhoneInput.svelte (1)

2-2: PhoneInput props import tightened up

Thanks for making PhoneInputProps type-only—this keeps the Svelte output lean without altering behavior.

src/lib/bottom-navigation/BottomNavHeader.svelte (1)

4-4: BottomNavHeader props correctly marked as type-only

Good call on the import type; this matches the rest of the cleanup and avoids redundant runtime imports.

src/lib/darkmode/DarkMode.svelte (1)

4-4: Darkmode props import aligns with the type-only pattern

This keeps the compiled JS free from noop imports while preserving typing. Looks solid.

src/lib/device-mockups/Desktop.svelte (1)

2-2: Desktop props import correctly scoped to types

import type here ensures the mockup component no longer emits empty imports downstream. 👍

src/lib/types.ts (1)

5-8: Writable/VariantProps now imported as types only

Confirmed both are used strictly in type positions (Writable<object>, VariantProps<typeof gradientButton>), so this change trims the emitted JS without side effects.

src/lib/utils/Arrow.svelte (1)

4-4: ArrowProps import converted to type-only

Great to see this follow the same pattern—no runtime dependency needed, and the component still type-checks as before.

src/lib/stepper/VerticalStepper.svelte (1)

4-4: Type-only props import is spot on.

Using import type here ensures the generated JS stops pulling in the $lib entrypoint at runtime, which is exactly what we need to avoid the empty import issue reported in the REPL.

src/lib/device-mockups/Laptop.svelte (1)

2-2: Good switch to a pure type import.

LaptopProps is only used for typing the $props() destructure, so this keeps the runtime bundle clean while preserving typings.

src/lib/utils/CloseButton.svelte (1)

3-3: Import tightening looks great.

This component only needs CloseButtonProps for type inference, so converting it to import type neatly avoids emitting the empty runtime import.

src/lib/device-mockups/Smartwatch.svelte (1)

2-2: Thanks for making this type-only.

SmartwatchProps is compile-time only, and this change keeps the output free of the problematic empty import.

src/lib/stepper/ProgressStepper.svelte (1)

4-4: Type-only import aligns with the goal.

ProgressStepperProps is never used as a runtime value, so this change addresses the REPL complaint without touching behavior.

src/lib/step-indicator/StepIndicator.svelte (1)

3-3: Nice consistency update.

Moving StepIndicatorProps to a type-only import keeps parity with the neighboring StepIndicatorTheme typing and eliminates the generated empty import.

src/lib/device-mockups/DefaultMockup.svelte (1)

2-2: Looks good.

DefaultMockupProps is purely for typing the props destructure, so importing it with import type is the right call.

src/lib/kbd/Kbd.svelte (1)

4-4: All good here.

KbdProps never needs to exist at runtime, so making it a type-only import neatly avoids the empty import pattern.

src/lib/stepper/BreadcrumbStepper.svelte (1)

5-5: Type-only import aligns with TS best practices.

BreadcrumbStepperProps is only used for typing, so this change cleanly strips the runtime import without affecting behavior.

src/lib/tabs/TabItem.svelte (1)

2-2: Good call switching these to type-only.

All three symbols are used strictly for typing, so the import elision here is safe.

src/lib/skeleton/WidgetPlaceholder.svelte (1)

4-4: Props import now purely type-level—looks good.

No runtime references depend on WidgetPlaceholderProps, so this keeps the bundle leaner.

src/lib/bottom-navigation/BottomNavItem.svelte (1)

2-2: Nice tidy-up on the type-only import.

BottomNavContextType and BottomNavItemProps are both purely annotative here, so this refactor is spot on.

src/lib/forms/range/Range.svelte (1)

4-4: Import tightening makes sense.

RangeProps never needs a runtime presence, so this change is correct.

src/lib/bottom-navigation/BottomNavHeaderItem.svelte (1)

4-4: All good on the type-only conversion.

BottomNavHeaderItemProps is only referenced for typing, so this is safe.

src/lib/skeleton/TestimonialPlaceholder.svelte (1)

4-4: Type-only import here is correct.

TestimonialPlaceholderProps is used exclusively for typing, so this change is safe.

src/lib/footer/FooterCopyright.svelte (1)

4-4: Type-only import keeps bundle lean

Good call converting this to import type; the props shape stays in TS land without pulling anything into the runtime bundle. 👍

src/lib/card/Card.svelte (1)

2-2: Importing as type-only is appropriate

CardProps is consumed purely for typing the $props() destructure, so the type-only import is the right fix and avoids emitting an empty runtime import.

src/lib/table/Table.svelte (1)

5-5: Type-only import aligns with the intent.

Switching TableProps/TableCtxType to import type keeps the runtime bundle clean and resolves the empty import warning. Looks good.

src/lib/buttons/Button.svelte (1)

4-4: Good move to a type-only import.

Restricting SizeType and ButtonProps to import type avoids emitting a noop module load in the REPL scenario—exactly what we need here.

src/lib/stepper/DetailedStepper.svelte (1)

4-4: Typed props import is tidy.

DetailedStepperProps is purely a compile-time annotation, so the dedicated type import is the right call.

src/lib/breadcrumb/BreadcrumbItem.svelte (1)

2-2: Breadcrumb props constrained to type import works well.

This keeps the module from generating an empty runtime import while preserving the typing surface.

src/lib/clipboard/Clipboard.svelte (1)

4-4: Clipboard props now properly type-only.

Great to see this converted—prevents the REPL’s empty import issue without touching behavior.

src/lib/forms/helper/Helper.svelte (1)

3-3: HelperProps type import looks spot on.

No runtime usage here, so this keeps the bundle lean while satisfying TypeScript.

src/lib/indicator/Indicator.svelte (1)

4-4: Indicator props type-only import is correct.

Consistent with the rest of the cleanup and avoids generating an empty import.

src/lib/accordion/Accordion.svelte (1)

2-2: Accordion context/props pulled in as types only—nice.

This keeps AccordionCtxType and AccordionProps out of the runtime bundle, matching the goal of eliminating the empty imports.

src/lib/footer/FooterIcon.svelte (1)

4-4: Type-only import aligns with goal

Converting FooterIconProps to a type-only import removes the stray runtime import while preserving typings. Matches the PR objective.

src/lib/dropdown/DropdownItem.svelte (1)

5-5: Type-only import aligns with goal

DropdownItemProps is now erased at runtime, preventing the empty import issue without affecting behavior.

src/lib/stepper/Stepper.svelte (1)

4-4: Type-only import aligns with goal

Switching StepperProps to import type keeps runtime bundles clean while preserving the prop typing.

src/lib/footer/FooterBrand.svelte (1)

4-4: Type-only import aligns with goal

FooterBrandProps no longer contributes to runtime imports, satisfying the empty import fix.

src/lib/button-group/ButtonGroup.svelte (1)

5-5: Type-only import aligns with goal

The type-only import ensures ButtonGroupProps is stripped from runtime output while keeping typings intact.

src/lib/footer/FooterLinkGroup.svelte (1)

4-4: Type-only import aligns with goal

FooterLinkGroupProps is now purely a type dependency, preventing the REPL’s empty import complaint.

src/lib/dropdown/DropdownGroup.svelte (1)

4-4: Type-only import aligns with goal

DropdownGroupProps is correctly converted to a type-only import, avoiding unnecessary runtime references.

src/lib/forms/checkbox/CheckboxButton.svelte (1)

2-2: Type-only import aligns with goal

Using import type for CheckboxButtonProps eliminates the runtime import while keeping typing precise.

src/lib/footer/FooterLink.svelte (1)

4-4: Type-only import looks good

Switching to import type keeps the runtime bundle clean and matches our convention.

src/lib/dropdown/DropdownHeader.svelte (1)

4-4: Nice consistency update

Type-only import here prevents accidental runtime pulls and aligns with the rest of the dropdown components.

src/lib/dropdown/DropdownDivider.svelte (1)

4-4: LGTM on import cleanup

The import type conversion keeps this divider lean at runtime and matches the PR goal.

src/lib/forms/button-toggle/ButtonToggle.svelte (1)

7-7: Good call on type-only context import

Moving both ButtonToggleProps and ButtonToggleContext to import type avoids shipping unused code while preserving typings.

src/lib/forms/label/Label.svelte (1)

4-4: Label props import update approved

Type-only import here keeps the label component aligned with our TS hygiene.

src/lib/footer/Footer.svelte (1)

4-4: Footer import aligns with PR intent

import type { FooterProps } is the right move—keeps runtime clean and consistent with the rest of the footer suite.

import { radio } from ".";
import clsx from "clsx";
import { type RadioProps, Label } from "$lib";
import type { RadioProps, Label } from "$lib";
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🔴 Critical

Restore value import for Label component.

Label is rendered in the template (Line 19), so making it a type-only import removes the runtime value and triggers a reference error at build/runtime. Reintroduce a value import for Label.

-import type { RadioProps, Label } from "$lib";
+import { Label, type RadioProps } from "$lib";
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
import type { RadioProps, Label } from "$lib";
import { Label, type RadioProps } from "$lib";
🤖 Prompt for AI Agents
In src/lib/forms/radio/Radio.svelte around line 5, the current import makes
Label a type-only import which removes the runtime value and causes a reference
error when Label is rendered; change the import so Label is imported as a
runtime value (e.g., keep RadioProps as a type import but import Label as a
value) and ensure Label is exported from "$lib" so the component can render
without build/runtime errors.

import { listGroup } from ".";
import clsx from "clsx";
import { type ListgroupProps, ListgroupItem } from "$lib";
import type { ListgroupProps, ListgroupItem } from "$lib";
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🔴 Critical

Restore runtime import for ListgroupItem.

Converting ListgroupItem to a type-only import removes the component from the runtime bundle. Because the template instantiates <ListgroupItem> (e.g., Line 35 onward), Svelte needs a value import; otherwise the compiler will emit ListgroupItem is not defined and render fails. Please keep ListgroupItem as a runtime import while leaving ListgroupProps type-only:

-import type { ListgroupProps, ListgroupItem } from "$lib";
+import { ListgroupItem, type ListgroupProps } from "$lib";
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
import type { ListgroupProps, ListgroupItem } from "$lib";
import { ListgroupItem, type ListgroupProps } from "$lib";
🤖 Prompt for AI Agents
In src/lib/list-group/Listgroup.svelte around line 5, the import converted
ListgroupItem to a type-only import which removes the component from the runtime
bundle and causes "ListgroupItem is not defined" at render; restore
ListgroupItem as a runtime value import while keeping ListgroupProps as
type-only (either by splitting into two imports or using a mixed import that
only marks ListgroupProps with "type"), so the Svelte template can reference
<ListgroupItem> at runtime.

@shinokada shinokada merged commit f439251 into themesberg:main Sep 25, 2025
0 of 2 checks passed
@shinokada
Copy link
Collaborator

Unfortunately that's not the solution.

Error compiling component
Could not find dist/accordion/ in [email protected] (error occurred while trying to resolve ./ within npm://$/[email protected]/dist/accordion/Accordion.svelte)

image

@shinokada
Copy link
Collaborator

I fixed the problem now. Thank you for your tips.
However Svelte REPL doesn't support tailwindcss@v4, so all the styling are not applied.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Svelte REPL problem
2 participants